{template 'common/header'}
<link rel="stylesheet" type="text/css" href="{MODULE_URL}template/style/main.css">

<div class="page-title">文章管理页面</div>

<div class="btn btn-success add-article">
	<a href="{php echo url('site/entry/articleEdit', array('m' => 'yts_qiye'));}">新增文章</a>
	
</div>

<div class="panel panel-info">
		<div class="panel-heading">筛选</div>
		<div class="panel-body">
		   <form action="" method="post" class="form-inline" id="setting-form">
				<div class="form-group col-sm-3">
						<label class="col-xs-12 col-sm-4 col-md-2 col-lg-3 control-label">标题</label>
						<div class="col-sm-8 col-lg-5">
							<input class="form-control" name="title" id="" type="text" value="{$_GPC['title']}" placeholder="可查询标题"> 
						</div>                  
					</div>
			<div class="form-group col-sm-3">
				<label class="col-xs-12 col-sm-4 col-md-2 col-lg-3 control-label">  分类</label>
				<div class="col-sm-8 col-lg-8">
	
						<select name="category_id" >
								<option value="0" {if !$category_id} selected="selected" {/if} >全部</option>
								{loop $category_info $index $item}
									<option value="{$item['id']}" {if $category_id == $item['id']} selected="selected" {/if} >{$item['title']}</option>
								
								{/loop}
						</select>
	
	
					
				</div>                  
			</div>
	
	
	
				<div class="form-group">
					<div class="col-sm-offset-1 col-sm-12">
					  <input type="submit" name="submit" value="搜索">
					  <input type="hidden" name="token" value="{$_W['token']}" />
					</div>
				</div>
			</form>
		</div>
	</div>


	
<table class="table table-striped table-bordered table-hover">
    <thead>
    <tr>
        <th>ID</th>
		<th>标题</th>
		<th>分类</th>
		<th>封面</th>
		<th>作者</th>

        <th>提交时间</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>

    {loop $formresult $index $item}
	<tr>
	    <td>{$item['id']}</td>
		<td>{$item['title']}</td>
		<td>{$item['category_name']}</td>
		<td class="text-center"><img class="pic" src="{$item['img_path']}"></td>
	    <td>{$item['user']['username']}</td>
	    <td>{php echo date('Y-m-d H:i:s', $item['add_time'])}</td>
	    <td>

				<a href="{php echo $this->createWebUrl('ArticleDel',array('id' => $item['id']))}" onclick="return confirm('你确定要删除吗？')" 
						class="btn btn-danger">删除</a>

			<a class="btn btn-success" href="{php echo url('site/entry/ArticleEdit', array('m' => 'yts_qiye','id'=>$item['id'],'op'=>'edit'));}">编辑</a>
		</td>
	</tr>
	{/loop}
    </tbody>
</table>
<div class="showPage">{$_pagination_var}</div>


{template 'common/footer'}